﻿using Custom.Model.Entity;
using Custom.Service.Repository;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Custom.Business.Custom
{
    public partial class frmCustomView : frmCustomAdd
    {
        private CustomInfo custom = null;

        public frmCustomView(int cusid)
        {
            InitializeComponent();

            this.custom = new CustomInfoRepository().Get(cusid);
        }

        /// <summary>
        /// 初始化页面数据
        /// </summary>
        protected override void initData()
        {
            base.btnSave.Visible = false;
            base.btnCancel.Text = "关闭";
            base.txtCardNo.Text = this.custom.cardno;
            base.ddlLevel.SelectedValue = this.custom.level;
            base.txtName.Text = this.custom.cusname;
            if (this.custom.sex == "0")
            {
                base.rbMan.Checked = true;
            }
            else
            {
                base.rbWoman.Checked = true;
            }
            base.txtIdentityNo.Text = this.custom.identityno;
            base.txtBirthday.Enabled = true;
            base.txtBirthday.Text = this.custom.birthday;
            base.txtBirthday.Enabled = false;
            base.txtAddress.Text = this.custom.address;
            base.txtMobile.Text = this.custom.mobile;
            base.txtQQ.Text = this.custom.qq;
            base.txtEmail.Text = this.custom.email;
            base.txtMemo.Text = this.custom.memo;
        }
    }
}
